home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
.net 2002 March
/
DotNetMagazine-Issue107-Coverdisc-NET107-02-03-PCMac.bin
/
pc
/
PC Software
/
free_browsing
/
DavesQckSearchDbar3-14
/
dqsd.exe
/
searches
/
sb.xml
< prev
next >
Wrap
Text File
|
2002-08-30
|
6KB
|
159 lines
<search function="sb">
<name>Switchboard</name>
<description>
Look up people and businesses by name or telephone number or browse all businesses in a given category. The location can be just a state or the city and state separated by a comma.<br/>
<div class="helpboxDescLabels">Usage:</div>
<table class="helpboxDescTable">
<tr><td>Person/Business</td><td> - </td><td>sb <<i>name</i>> [(<<i>location</i>>)] {/person | /business | /category}</td></tr>
<tr><td>Telephone</td><td> - </td><td>sb <<i>number</i>> {/person | /business}</td></tr>
</table>
<div class="helpboxDescLabels">Switches:</div>
<table class="helpboxDescTable">
<tr><td>/person</td><td> - </td><td>Search for a person at the given location.</td></tr>
<tr><td>/business</td><td> - </td><td>Search for a business at the given location.</td></tr>
<tr><td>/category</td><td> - </td><td>Searches for all businesses of the given category at the given location.</td></tr>
</table>
<div class="helpboxDescLabels">Examples:</div>
<table class="helpboxDescTable">
<tr><td>sb barbers (Pittsford, NY) /business</td></tr>
<tr><td>sb John Doe (IL) /person</td></tr>
<tr><td>sb Barbers (Los Angelas, CA) /category</td></tr>
<tr><td>sb 214-555-9090</td></tr>
<tr><td>sb 214.555.9090 /person</td></tr>
<tr><td>sb 2145559090 /business</td></tr>
</table>
</description>
<category>People and Places</category>
<link>http://www.switchboard.com/</link>
<contributor>Ryan Edwards</contributor>
<form name="sbf_indv"
action="http://www.switchboard.com/bin/cgiqa.dll"
method="get">
<input type="hidden" name="SR" value=""/>
<input type="hidden" name="MEM" value="1"/>
<input type="hidden" name="F" value=""/>
<input type="hidden" name="L" value=""/>
<input type="hidden" name="T" value=""/>
<input type="hidden" name="s" value=""/>
</form>
<form name="sbf_phone"
action="http://www.switchboard.com/bin/cgirlookup.dll"
method="get">
<input type="hidden" name="at" value=""/>
<input type="hidden" name="e" value=""/>
<input type="hidden" name="n" value=""/>
<input type="hidden" name="type" value=""/>
<input type="hidden" name="SR" value=""/>
<input type="hidden" name="MEM" value=""/>
<input type="hidden" name="LNK" value=""/>
</form>
<form name="sbf_bus"
action="http://www.switchboard.com/bin/cgidir.dll"
method="get">
<input type="hidden" name="FUNC" value="FORMATSEARCH"/>
<input type="hidden" name="MEM" value="1"/>
<input type="hidden" name="TYPE" value=""/>
<input type="hidden" name="C" value=""/>
<input type="hidden" name="L" value=""/>
<input type="hidden" name="T" value=""/>
<input type="hidden" name="s" value=""/>
</form>
<script><![CDATA[
function sb(q)
{
var searchGroup = 0;
var args = parseArgs(q, "person, business, category");
if( nullArgs("sb",args.q) )
{
return false;
}
else
{
if( args.switches.length == 1 )
{
for( var j=0; j<args.switches.length; j++ )
switch( args.switches[j].name )
{
case "person": searchGroup = 0; break;
case "business": searchGroup = 1; break;
case "category": searchGroup = 2; break;
}
}
// else ... default to person search
// The search was for a phone number, so do a reverse lookup.
var parsed = args.q.match( /(\d{3})-*\.*(\d{3})-*\.*(\d{4})/ );
if( parsed )
{
switch( searchGroup )
{
case 0: document.sbf_phone.type.value = "RES"; break;
case 1: document.sbf_phone.type.value = "BUS"; break;
case 2: nullArgs("sb","?"); return false;
default: document.sbf_phone.type.value = "BOTH"; break;
}
document.sbf_phone.at.value = parsed[1];
document.sbf_phone.e.value = parsed[2];
document.sbf_phone.n.value = parsed[3];
submitForm(sbf_phone);
}
// Individual person search.
else if( searchGroup == 0 )
{
parsed = args.q.match( /(((\w+\s+)?\w+)\s+)?(\w+)(\s*\((([^,]+),?\s*)?(\w\w)\))?/ );
document.sbf_indv.F.value=(parsed[2] ? parsed[2] : "");
document.sbf_indv.L.value=(parsed[4] ? parsed[4] : "");
document.sbf_indv.T.value=(parsed[7] ? parsed[7] : "");
document.sbf_indv.s.value=(parsed[8] ? parsed[8].toUpperCase() : "");
submitForm(sbf_indv);
}
else if( searchGroup > 0 )
{
parsed = args.q.match( /(\w[^\(]*\w)(\s*\((([^,]+),?\s*)?(\w\w)\))?/ );
document.sbf_bus.T.value=(parsed[4] ? parsed[4] : "");
document.sbf_bus.s.value=(parsed[5] ? parsed[5].toUpperCase() : "");
switch( searchGroup )
{
// Business search.
case 1:
document.sbf_bus.L.value=(parsed[1] ? parsed[1] : "");
document.sbf_bus.C.value="";
break;
// Business category search.
case 2:
document.sbf_bus.C.value=(parsed[1] ? parsed[1] : "");
document.sbf_bus.L.value="";
break;
}
submitForm(sbf_bus);
}
else
{
nullArgs( "sb", "?" );
return false;
}
}
}
]]></script>
<copyright>
Copyright (c) 2002 David Bau
Distributed under the terms of the
GNU Public License, Version 2 (http://www.gnu.org/copyleft/gpl.txt)
</copyright>
</search>